package single.enums;

/**
 * 因为枚举类，本身就是private化的构造函数
 */
public enum EnumManager {

    Android(1) {
        @Override
        public EnumManager create() {
            return Android;
        }
    },

    IOS(2) {
        @Override
        public EnumManager create() {
            return IOS;
        }
    },

    Web(3) {
        @Override
        public EnumManager create() {
            return Web;
        }
    };

    private Single instance;

    public Single getInstance() {
        return instance;
    }

    public abstract EnumManager create();

    EnumManager(int type) {
        if (instance == null) {
            instance = new Single();
        }
    }
}
